package facade;

import dao.AbstractDAOFactory;
import dao.ApplicationSettingsDAO;
import dao.FolderDAO;
import dao.ImageEntryDAO;

public class AppFacadeImpl implements AppFacade {
    ImageEntryDAO imageEntryDAO;
    FolderDAO folderDAO;
    ApplicationSettingsDAO applicationSettingsDAO;
    AbstractDAOFactory abstractDAOFactory;

    public AppFacadeImpl(AbstractDAOFactory abstractDAOFactory) throws Exception {
        this.abstractDAOFactory = abstractDAOFactory;
        this.applicationSettingsDAO = abstractDAOFactory.getApplicationSettingsDAO();
        this.folderDAO = abstractDAOFactory.getFolderDAO();
        this.imageEntryDAO = abstractDAOFactory.getImageEntryDAO();
    }

    public void exit() throws Exception {
        applicationSettingsDAO.close();
        folderDAO.close();
        imageEntryDAO.close();
    }
}
